import { Record } from 'immutable';

const DEFAULTS = {
  name: undefined,
  id: undefined
};
class BaseType extends Record(DEFAULTS) {
  static create(attr = {}) {
    const { name, id } = attr;
    return new BaseType({ name, id });
  }

  static number = BaseType.create({ name: 'number', id: 'number' });
  static string = BaseType.create({ name: 'string', id: 'string' });
  static date = BaseType.create({ name: 'date', id: 'date' });
}

export default BaseType;
